package com.qiwenshare.file.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qiwenshare.file.domain.user.UserBean;
import com.qiwenshare.file.mapper.UserfileHistoryMapper;
import com.qiwenshare.file.domain.UserfileHistory;
import com.qiwenshare.file.api.UserfileHistoryService;
import com.qiwenshare.file.vo.UserFileHistoryVo;
import com.qiwenshare.file.vo.user.UserLoginVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 文件操作历史表(UserfileHistory)表服务实现类
 *
 * @author makejava
 * @since 2023-09-23 20:58:36
 */
@Service("userfileHistoryService")
public class UserfileHistoryServiceImpl extends ServiceImpl<UserfileHistoryMapper, UserfileHistory> implements UserfileHistoryService {

    @Resource
    private UserfileHistoryMapper historyMapper;

    @Override
    public IPage<UserFileHistoryVo> getHistoryList(Integer operationType, String loginAccount, Integer fileMode, Long currentPage, Long pageCount) {
        Page<UserFileHistoryVo> page = new Page<>(currentPage, pageCount);
        return historyMapper.selectPageVo(page, operationType, loginAccount, fileMode == null ? 1 : fileMode);
    }

    @Override
    public List<UserFileHistoryVo> queryDetail(String userFileId) {
        return historyMapper.queryDetail(userFileId);
    }
}

